import { sm3 } from "sm-crypto-v2";
import { Buffer } from "buffer";

/**
 * SM3签名
 * @param data 待签名数据
 * @returns 签名结果
 */
export function signSM3(data: string): string {
  return Buffer.from(sm3(data), "hex").toString("base64");
}
